package com.lam.system.entity;

import com.lam.common.validate.group.Add;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelProperty;
import com.lam.common.validate.annotation.DictCheck;
import com.lam.common.utils.DateUtil;
import com.lam.common.validate.annotation.DictValid;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import com.lam.common.components.dict.annotation.Dict;
import com.baomidou.mybatisplus.annotation.TableField;
import javax.validation.constraints.Null;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lam.common.components.easyexcel.converter.DictConverter;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lam.common.base.domain.BaseEntity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.lam.common.base.domain.tree.BaseTree;

/**
 * 组织机构对象 sys_dept
 * 
 * @author admin
 * @date 2022-10-18
 */
@DictCheck
@ColumnWidth(30)
@TableName("sys_dept")
public class SysDept extends BaseTree<SysDept> implements BaseEntity{

    /** 主键 */
    @ExcelIgnore
    @Null(groups = Add.class, message="id必须为空")
    @TableId(type = IdType.AUTO)
    private String id;
    
    /** 父机构id */
    @ExcelProperty("父机构id")
    private String parentId;

    /** 机构编码 */
    @ExcelProperty("机构编码")
    @NotBlank(message = "机构编码不能为空")
    @Size(max = 50, message = "机构编码长度不能超过50个字符")
    private String deptCode;

    /** 机构名称 */
    @ExcelProperty("部门名称")
    @NotBlank(message = "部门名称不能为空")
    @Size(max = 30, message = "部门名称长度不能超过30个字符")
    private String deptName;

    /** 排序 */
    @ExcelProperty("排序")
    private BigDecimal sortNo;

    /** 状态(0-不可用, 1-可用) */
    @ExcelProperty(value = "状态", converter = DictConverter.class)
    @NotNull(message = "状态不能为空")
    @DictValid(message = "无效的状态")
    @Dict(dictCode = "status_type")
    private Integer status;

    /** 创建人 */
    @ExcelProperty("创建人")
    private String createBy;

    /** 创建时间 */
    @ExcelProperty("创建时间")
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /** 更新人 */
    @ExcelProperty("更新人")
    private String updateBy;

    /** 更新时间 */
    @ExcelProperty("更新时间")
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /** 备注 */
    @ExcelProperty("备注")
    @Size(max = 255, message = "备注长度不能超过255个字符")
    private String remark;


    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    } 

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentId() {
        return parentId;
    }    
    
    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }

    public String getDeptCode() {
        return deptCode;
    }    
    
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getDeptName() {
        return deptName;
    }    
    
    public void setSortNo(BigDecimal sortNo) {
        this.sortNo = sortNo;
    }

    public BigDecimal getSortNo() {
        return sortNo;
    }    
    
    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }    
    
    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateBy() {
        return createBy;
    }    
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCreateTime() {
        return createTime;
    }    
    
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }    
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }    
    
    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRemark() {
        return remark;
    }    
    

}
